import requests
from bs4 import BeautifulSoup
#导入爬虫的库，不然调用不了爬虫的函数

response = requests.get("https://www.cnblogs.com/gdjlc/p/11400523.html")  #生成一个response对象
response.encoding = response.apparent_encoding #设置编码格式

print("状态码:"+ str( response.status_code ) ) #打印状态码
soup = BeautifulSoup(response.text, 'html.parser') #lxml为解析器
print(soup)#输出爬取的信息
